% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dataload_from_package.R
\name{dataload_from_package}
\alias{dataload_from_package}
\title{Utility to load a couple of datasets using data immediately instead of relying on lazy loading}
\usage{
dataload_from_package(
  olist = c("blockgroupstats", "usastats", "statestats"),
  envir = globalenv()
)
}
\arguments{
\item{olist}{vector of strings giving names of objects to load using data().
This could also include other large datasets that are slow to lazyload but not always needed:
"frs", "frs_by_programid ", "frs_by_naics", etc.}

\item{envir}{the environment into which they should be loaded}
}
\value{
Nothing
}
\description{
Utility to load a couple of datasets using data immediately instead of relying on lazy loading
}
\details{
See also read_builtin() function from the readr package!

Default is to load some but not all the datasets into memory immediately.
\link{blockgroupstats}, \link{usastats}, \link{statestats}, and some others are always essential to EJAM, but
\link{frs} and \link{frs_by_programid} are huge datasets (and \link{frs_by_sic} and \link{frs_by_naics})
and not always used - only to find regulated facilities by ID, etc.
The frs-related datasets here can be roughly 1.5 GB in RAM, perhaps.
}
\examples{
  x <- datapack("EJAM")
  subset(x, x$size >= 0.1) # at least 100 KB
  grep("names_", x$Item, value = T, ignore.case = T, invert = T) # most were like names_d, etc.
  ls()
  data("avg.in.us", package="EJAM") # lazy load an object into memory and make it visible to user
  ls()
  rm(avg.in.us, x)
  
}
\seealso{
\code{\link[=datapack]{datapack()}} \code{\link[=dataload_from_aws]{dataload_from_aws()}} \code{\link[=dataload_from_pins]{dataload_from_pins()}} \code{\link[=dataload_from_local]{dataload_from_local()}} \code{\link[=indexblocks]{indexblocks()}} \code{\link[=.onAttach]{.onAttach()}}
}
\keyword{internal}
